package g4p.tests;

import g4p_controls.G4P;
import g4p_controls.GAlign;
import g4p_controls.GCScheme;
import g4p_controls.GCheckbox;
import g4p_controls.GDropList;
import g4p_controls.GEvent;
import g4p_controls.GKnob;
import g4p_controls.GLabel;
import g4p_controls.GOption;
import g4p_controls.GSlider;
import g4p_controls.GSlider2D;
import g4p_controls.GStick;
import g4p_controls.GTextArea;
import g4p_controls.GTextField;
import g4p_controls.GToggleGroup;
import processing.core.PApplet;

public class DrawOrderTest extends PApplet {

	
	public void setup(){
		  size(480, 320, JAVA2D);
		  createGUI();
		  customGUI();
		  // Place your setup code here
		  
		}

		public void draw(){
		  background(230);
		  
		}

		// Use this method to add additional statements
		// to customise the GUI controls
		public void customGUI(){

		}
		
		
		/* =========================================================
		 * ====                   WARNING                        ===
		 * =========================================================
		 * The code in this tab has been generated from the GUI form
		 * designer and care should be taken when editing this file.
		 * Only add/edit code inside the event handlers i.e. only
		 * use lines between the matching comment tags. e.g.

		 void myBtnEvents(GButton button) { //_CODE_:button1:12356:
		     // It is safe to enter your event code here  
		 } //_CODE_:button1:12356:
		 
		 * Do not rename this tab!
		 * =========================================================
		 */

		public void dropList1_click1(GDropList source, GEvent event) { //_CODE_:dropList1:519803:
		  println("dropList1 - GDropList event occured " + System.currentTimeMillis()%10000000 );
		} //_CODE_:dropList1:519803:

		public void textfield1_change1(GTextField source, GEvent event) { //_CODE_:textfield1:624387:
		  println("textfield1 - GTextField event occured " + System.currentTimeMillis()%10000000 );
		} //_CODE_:textfield1:624387:

		public void textarea1_change1(GTextArea source, GEvent event) { //_CODE_:textarea1:306075:
		  println("textarea1 - GTextArea event occured " + System.currentTimeMillis()%10000000 );
		} //_CODE_:textarea1:306075:

		public void slider2d1_change1(GSlider2D source, GEvent event) { //_CODE_:slider2d1:837265:
		  println("slider2d1 - GSlider2D event occured " + System.currentTimeMillis()%10000000 );
		} //_CODE_:slider2d1:837265:

		public void knob1_turn1(GKnob source, GEvent event) { //_CODE_:knob1:316161:
		  println("knob1 - GKnob event occured " + System.currentTimeMillis()%10000000 );
		} //_CODE_:knob1:316161:

		public void stick1_change1(GStick source, GEvent event) { //_CODE_:stick1:303395:
		  println("stick1 - GStick event occured " + System.currentTimeMillis()%10000000 );
		} //_CODE_:stick1:303395:

		public void checkbox1_clicked1(GCheckbox source, GEvent event) { //_CODE_:checkbox1:647533:
		  println("checkbox1 - GCheckbox event occured " + System.currentTimeMillis()%10000000 );
		} //_CODE_:checkbox1:647533:

		public void option1_clicked1(GOption source, GEvent event) { //_CODE_:option1:915423:
		  println("option1 - GOption event occured " + System.currentTimeMillis()%10000000 );
		} //_CODE_:option1:915423:

		public void slider1_change1(GSlider source, GEvent event) { //_CODE_:slider1:730970:
		  println("slider1 - GSlider event occured " + System.currentTimeMillis()%10000000 );
		} //_CODE_:slider1:730970:



		// Create all the GUI controls. 
		// autogenerated do not edit
		public void createGUI(){
		  G4P.messagesEnabled(false);
		  G4P.setGlobalColorScheme(GCScheme.BLUE_SCHEME);
		  G4P.setCursor(ARROW);
		  if(frame != null)
		    frame.setTitle("Sketch Window");
		  dropList1 = new GDropList(this, 18, 14, 438, 176, 8);
		  dropList1.setItems(loadStrings("g4p/list_519803"), 0);
		  dropList1.setLocalColorScheme(GCScheme.RED_SCHEME);
		  dropList1.addEventHandler(this, "dropList1_click1");
		  label1 = new GLabel(this, 22, 52, 80, 20);
		  label1.setText("My label");
		  label1.setOpaque(true);
		  textfield1 = new GTextField(this, 24, 83, 83, 30, G4P.SCROLLBARS_HORIZONTAL_ONLY);
		  textfield1.setOpaque(true);
		  textfield1.addEventHandler(this, "textfield1_change1");
		  textarea1 = new GTextArea(this, 115, 55, 118, 80, G4P.SCROLLBARS_BOTH);
		  textarea1.setOpaque(true);
		  textarea1.addEventHandler(this, "textarea1_change1");
		  slider2d1 = new GSlider2D(this, 386, 46, 50, 50);
		  slider2d1.setLimitsX(0.5f, 0.0f, 1.0f);
		  slider2d1.setLimitsY(0.5f, 0.0f, 1.0f);
		  slider2d1.setNumberFormat(G4P.DECIMAL, 2);
		  slider2d1.setOpaque(true);
		  slider2d1.addEventHandler(this, "slider2d1_change1");
		  knob1 = new GKnob(this, 318, 47, 60, 60, 0.8f);
		  knob1.setTurnRange(110, 70);
		  knob1.setTurnMode(GKnob.CTRL_HORIZONTAL);
		  knob1.setSensitivity(1);
		  knob1.setShowArcOnly(false);
		  knob1.setOverArcOnly(false);
		  knob1.setIncludeOverBezel(false);
		  knob1.setShowTrack(true);
		  knob1.setLimits(0.5f, 0.0f, 1.0f);
		  knob1.setShowTicks(true);
		  knob1.setOpaque(false);
		  knob1.addEventHandler(this, "knob1_turn1");
		  stick1 = new GStick(this, 250, 55, 60, 60);
		  stick1.setMode(G4P.X4);
		  stick1.setOpaque(false);
		  stick1.addEventHandler(this, "stick1_change1");
		  checkbox1 = new GCheckbox(this, 29, 118, 120, 20);
		  checkbox1.setText("checkbox text");
		  checkbox1.setTextAlign(GAlign.LEFT, GAlign.MIDDLE);
		  checkbox1.setOpaque(true);
		  checkbox1.addEventHandler(this, "checkbox1_clicked1");
		  togGroup1 = new GToggleGroup();
		  option1 = new GOption(this, 75, 131, 120, 20);
		  option1.setText("option text");
		  option1.setTextAlign(GAlign.LEFT, GAlign.MIDDLE);
		  option1.setOpaque(true);
		  option1.addEventHandler(this, "option1_clicked1");
		  togGroup1.addControl(option1);
		  option1.setSelected(true);
		  slider1 = new GSlider(this, 318, 119, 100, 40, 10.0f);
		  slider1.setLimits(0.5f, 0.0f, 1.0f);
		  slider1.setNumberFormat(G4P.DECIMAL, 2);
		  slider1.setOpaque(false);
		  slider1.addEventHandler(this, "slider1_change1");
		}

		// Variable declarations 
		// autogenerated do not edit
		GDropList dropList1; 
		GLabel label1; 
		GTextField textfield1; 
		GTextArea textarea1; 
		GSlider2D slider2d1; 
		GKnob knob1; 
		GStick stick1; 
		GCheckbox checkbox1; 
		GToggleGroup togGroup1; 
		GOption option1; 
		GSlider slider1; 

}
